home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / µSim 1.1 / FabLibsƒ / CursorBalloon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-11  |  3.1 KB  |  101 lines  |  [TEXT/CWIE]

  1. #ifndef __FABCURSORBALLOON__
  2. #define __FABCURSORBALLOON__
  3.  
  4. /* this also distinguishes a normal window from a window with objects */
  5.  
  6. enum windowclasses {
  7. kFabWindowClass = 10
  8. };
  9.  
  10. /* this is my window record, containing
  11. the procedures normally called when handling events (if you do not want to
  12. undertake special actions i.e. for dragging, pass nil), the number of
  13. objects, and a Handle to the objects */
  14.  
  15. typedef struct RgnBalloonCurs RgnBalloonCurs;
  16. typedef RgnBalloonCurs *RgnBalloonCursPtr;
  17. typedef RgnBalloonCursPtr *RgnBalloonCursHandle;
  18.  
  19. struct FabWindowRec {
  20.     void (*activateProc)(EventRecord *, DialogRef, Handle cntlList, short defItem, Boolean);
  21.     void (*updateProc)(WindowRef, short defItem);
  22.     void (*dragProc)(WindowRef);
  23.     void (*growProc)(WindowRef, EventRecord *);
  24.     void (*zoomProc)(WindowRef, short);
  25.     void (*goAwayProc)(WindowRef);
  26.     void (*contentProc)(WindowRef, EventRecord *);
  27.     void (*getDragHiliteRectProc)(WindowRef, RectPtr);
  28.     Boolean (*canIAcceptDrag)(const HFSFlavor *);
  29.     OSErr (*dragReaction)(WindowRef, const HFSFlavor *);
  30.     unsigned long    objCount;
  31.     DragTrackingHandlerUPP    trackUPP;
  32.     DragReceiveHandlerUPP    recUPP;
  33.     RgnBalloonCursHandle    myZones;
  34.     Handle                    cntlList;
  35.     short                    defItem;
  36.     Boolean                    currentlyShowingProgressCurs;
  37.     };
  38.  
  39. typedef struct FabWindowRec FabWindowRec;
  40. typedef FabWindowRec *FabWindowPtr;
  41.  
  42. /* this is a generic object belonging to a window */
  43.  
  44. struct RgnBalloonCurs {
  45.     void (*recalcRgnProc)(DialogRef, RgnBalloonCursPtr);
  46.     RgnHandle    zoneLocal;
  47.     RgnHandle    zoneGlobal;
  48.     CursHandle    curs;
  49.     unsigned long    myBalloon;
  50.     short        balloonVariant;
  51.     short        itemID;
  52.     };
  53.  
  54. #pragma internal on
  55. //==========================================================
  56.  
  57. OSErr InstallRgnHandler(FabWindowPtr w, RgnHandle whichRgn, void (*recalcProc)(DialogRef, RgnBalloonCursPtr),
  58.                         CursHandle cursor,
  59.                         unsigned long balloon, short ballnVariant, short iID);
  60. void RecalcMouseRegion(DialogRef d, Point mouse);
  61. FabWindowPtr ResizeObjects(DialogRef w);
  62. void RecalcGlobalCoords(FabWindowPtr w);
  63. //void DisposFabWindow(FabWindowPtr w);
  64. void ForceMouseMovedEvent(void);
  65. //void InitFabWindow(FabWindowPtr w);
  66.  
  67. //==========================================================
  68.  
  69. extern RgnHandle    mouseRgn, wideOpenRgn;
  70.  
  71. //==========================================================
  72. #pragma internal reset
  73.  
  74. /* useful macros */
  75.  
  76. #define toBalloon(m, i)        (((long)m << 16) + i)
  77.  
  78. #define Zones(w)            (w->myZones)
  79.  
  80. /* macros for setting the event handlers for the window, and
  81. prototypes of the handlers */
  82.  
  83. #define SetActivate(w, p)    w->activateProc = p
  84. #define SetUpdate(w, p)        w->updateProc = p
  85. #define SetDrag(w, p)        w->dragProc = p
  86. #define SetGrow(w, p)        w->growProc = p
  87. #define SetZoom(w, p)        w->zoomProc = p
  88. #define SetGoAway(w, p)        w->goAwayProc = p
  89. #define SetContent(w, p)    w->contentProc = p
  90. #define SetGetDragRect(w, p)    w->getDragHiliteRectProc = p
  91. #define SetCanIAcceptDrag(w, p)    w->canIAcceptDrag = p
  92. #define SetDragReaction(w, p)    w->dragReaction = p
  93.  
  94. #define NumObjects(w)        (w->objCount)
  95. #define OneMoreObject(w)    (w->objCount++)
  96.  
  97. //#define IsFabWindow(w)        (w && (GetWindowKind(w.u.w) == kFabWindowClass || (isMovableModal(w))))
  98.  
  99. #endif
  100.  
  101.